//
//  E7GameChildLayer.h
//  e7engine
//
//  Created by cc on 12-3-14.
//  Copyright (c) 2012年 PalmGame. All rights reserved.
//

#ifndef e7engine_E7GameChildLayer_h
#define e7engine_E7GameChildLayer_h

#include "E7GameDefine.h"

#include "E7Cell.h"

class CE7GameChildLayer : public CE7Layer
{
public:
    CE7GameChildLayer() ;
    ~CE7GameChildLayer() ;

    void InitBackSheet(const char* sheetfile, const unsigned int capacity, int z, int tag, CCNode* pParent = NULL) ;
    void InitCellSheet(const char* sheetfile, const unsigned int capacity, int z, int tag) ;
    void InitUnitSheet(const char* sheetfile, const unsigned int capacity, int z, int tag) ;
    void InitArrowSheet(const char* sheetfile, const unsigned int capacity, int z, int tag) ;

    void DrawCell() ;
    void DrawUnit() ;
    void DrawAttackCell() ;
    void Render() ;

    virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent);
	virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent);
	virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);
	virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent);

private:
    CCSpriteBatchNode*    m_pCellSheet ;
    CCRect*               m_pCellRect ;

    CCSpriteBatchNode*    m_pBackSheet ;
    CCRect                m_rcBackRect ;

    CCSpriteBatchNode*    m_pUnitSheet ;
    CCRect*               m_pUnitRect ;

    CCLayer*              m_pArrowRootLayer ;
    CCLayer*              m_pUnitRootLayer ;
} ;

#endif








